Repository navigation
Conversation
…y tests Travis has errored at setup on every build since at least 2025-08 (it can no longer download OTP 21.0.1), so no test has run in CI. The new workflow runs rebar3 eunit on OTP 22.3 (xmpp's version) against a Redis 7 service, on pull requests and pushes to xmpp_only. It is not a required check, and .travis.yml is left as is. Test fixes, all test-only: - connection_failure_during_start_reconnect_test: start_link/5 connects synchronously since 49c714f; use start_link/9 with SyncStart=false. Its failure left trap_exit on and broke 5 eredis_sub_tests. - crash_queue_test: expect {exited, N} before 'DOWN' (sent since 9427287). Its leftover messages broke the next 2 tests. - tcp_closed_rig: a query that reaches the client after the close gets no_connection; accept it (failed 1 in 10 runs locally). Locally (erlang:22 + redis:7): 63 tests, 0 failures, 40 of 40 runs. 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
The test still has a race where an early fake TCP close terminates the client before a query, leaving a worker unable to report its result and causing the test to time out.
1 open issue
What changed in this PR
This PR restores automated testing for the eredis fork used by xmpp, adding GitHub Actions coverage and updating stale or racy tests.
Changes:
- Run EUnit with OTP 22 and Redis 7 on pull requests and pushes to
xmpp_only. - Pin CI dependencies and limit workflow permissions and runtime.
- Update tests for asynchronous startup, subscriber exit notifications, and connection-close errors.
| File | Description |
|---|---|
test/eredis_tests.erl |
Request asynchronous startup explicitly and broaden accepted connection-close errors. |
test/eredis_sub_tests.erl |
Expect the subscriber’s exit notification before its monitor notification. |
.github/workflows/ci.yml |
Add the pinned OTP/Redis EUnit workflow. |
Review effort: Balanced
Comment on lines
+206
to
+207
| ?assertMatch({error, E} when E =:= tcp_closed; E =:= no_connection, | ||
| proplists:get_value(1, Results)), |
…sertions
The fake close could reach the client before a query; the no_reconnect client
then stops and the late eredis:q exits, so gather_remote_queries waited for a
result that never came. The rig now suspends the client until both requests
are in its mailbox, sends the close, then resumes: the close always lands after
the requests and before any Redis reply, so both get {error, tcp_closed}.
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
#17 added {meck, "1.2.0"} to the test profile; meck 1.2.0 needs OTP 25 and the CI image (like xmpp's build) is OTP 22.3, so rebar3 eunit stopped before running any test. 0.9.2 is the version xmpp pins on the same OTP. 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What
.github/workflows/ci.yml: runsrebar3 euniton OTP 22.3 (the same build xmpp uses) against a Redis 7 service, on every pull request and on pushes toxmpp_only. Actions and images are pinned by SHA/digest;contents: read; 15 min timeout.xmpp_only.Why
Travis has errored at setup on every build since at least 2025-08 (it can no longer download OTP 21.0.1, the first of 24 OTP versions in
.travis.yml), so no test has run in CI for over a year. This library runs on every xmpp task.Test fixes
connection_failure_during_start_reconnect_teststart_link/5connects synchronously since 49c714f (2019); the test expects the async start. Its failure lefttrap_exiton and broke 5eredis_sub_tests.start_link/9withSyncStart = falsecrash_queue_test{exited, N}before exiting since 9427287 (2024). Leftover messages broke the next 2 tests.{exited, _}, then'DOWN'tcp_closed_test/tcp_closed_no_reconnect_testno_connection. Failed 1 in 10 local runs.tcp_closedorno_connectionResults
xmpp_only.erlang:22+redis:7: 63 tests, 0 failures in 40 of 40 runs.Not in this PR
xmpp_only; branch protection is unchanged..travis.ymlis left as is, so the Travis checks stay red.Related Tickets
🤖 Generated with Claude Code